package leetcode.math;

public class FactorialTrailingZeroes172 {
    class Solution1 {
        public int trailingZeroes(int n) {
            return n == 0 ? 0 : n / 5 + trailingZeroes(n / 5);
        }
    }

    class Solution2 {
        public int trailingZeroes(int n) {
            int count = 0;
            while (n != 0) {
                n /= 5;
                count += n;
            }
            return count;
        }
    }
}
